home *** CD-ROM | disk | FTP | other *** search
/ Chip 2003 February / Chip_2003-02_cd1.bin / zkuste / xptools / install / Xsetup / setup.exe / {app} / plugins / XQ ComDlg Options 3.xpl < prev    next >
Text File  |  2002-10-27  |  4KB  |  145 lines

  1. "FILE"="Xteq Systems X-Setup Plugin 6.0"
  2. "TYPE"="8"
  3. "COUNT"="2"
  4. "UIPATH"="Appearance\System\Open/Save Dialog"
  5. "NAME"="Clear Open/Save MRU Entries"
  6. "VERSION"="1.02"
  7. "LANGUAGE"="VBScript"
  8. "OSVERSION"="000101"
  9. "TEXT 1"="Show Info"
  10. "TEXT 2"="Delete!"
  11. "DESCRIPTION 1"="Most programs use the build-in Open/Save dialog of Windows. Since Windows 2000, this dialog saves which files has been recently open or saved in a so called MRU list (MRU = Most Recent Used files)."
  12. "DESCRIPTION 2"="This MRU list is independent from the MRU list a program maybe provides, so it basically contains information about all files you have used recently."
  13. "DESCRIPTION 3"="It is organized by file type, so you see all file types in this plug-in that the MRU List currently contains. The name in brackets shows the user-friendly name of the file type. "
  14. "DESCRIPTION 4"="If you want to know which information have been saved about a file type, just click the "Show Info" button and the entries that are saved are displayed (please note that this list is truncated after 15 entries). To delete the information about this file type, just click the "Delete!" button. The entries will be totally erased."
  15. "AUTHOR"="Xteq Systems"
  16. "CONTACTURL"="http://www.xteq.com"
  17. "COPYRIGHT"="Copyright ⌐ Xteq Systems - All Rights Reserved"
  18. "COMMENT 1"="Infos about this plug-in found at  http://www.spywareinfo.com/articles/comdlg32/"
  19. "COMMENT 2"="Reference (from spywareinfo): http://msdn.microsoft.com/library/en-us/policy/policyovr_1cfn.asp?frame=true#_win32_remove_mru_list"
  20.  
  21.  
  22. sPath="HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32\OpenSaveMRU"
  23.  
  24. MRUListValue="MRUList"
  25.  
  26. dim iItems        'contains the total amount of the registry keys
  27. Dim aryItems()    'contains the name of the Registry paths 
  28.  
  29. Sub Plugin_Initialize 
  30.     iItems=0
  31.     Call ReadItems()
  32. End Sub
  33.  
  34. Sub Plugin_CheckData(ElementIndex)
  35. End Sub
  36.  
  37. Sub Plugin_Apply(ElementIndex,ElementSubIndex)
  38.  if ElementSubIndex<=0 then
  39.     Call MsgError("Please select an item first.")
  40.  else
  41.     s=GetUIElement(ElementSubIndex) 
  42.     i=InStr(s," ")
  43.     sItem=Left(s,i-1)
  44.  
  45.     If ElementIndex=1 then 'Show Info
  46.        sMsg="The following items are stored for your selection (max. 15 entries):"  
  47.        sMsg=sMsg & chr(13) & chr(10)
  48.        sMsg=sMsg & GetSingleInfo(sItem)
  49.  
  50.        Call MsgInformation(sMsg)
  51.     else
  52.        Call DeleteItem(sItem)
  53.        Call MsgInformation("Items have been deleted!")
  54.        Call ReadItems()
  55.     end if
  56.  end if
  57. End Sub
  58.  
  59.  
  60. Sub Plugin_Terminate 
  61. End Sub
  62.  
  63.  
  64. Sub ReadItems
  65.     'clear the UI
  66.     For l=1 to iItems
  67.         Call SetUIElement(l,"")
  68.     next 
  69.  
  70.     'read the registry
  71.     iItems=RegEnumPaths(sPath) 
  72.     
  73.  
  74.     For l=1 to iItems       
  75.         sItem=RegEnumElement(l)   
  76.         sTxt=GetFileDescription("." & sItem)
  77.  
  78.         Call SetUIElement(l,ucase(sItem) & " Files [" & sTxt & "]")
  79.     next 
  80. End Sub
  81.  
  82.  
  83. Function GetSingleInfo(Item)
  84.  iCount=RegEnumValues(sPath & "\" & Item)
  85.  
  86.  sOut=""
  87.  
  88.  For l=1 to iCount
  89.      'do not read MRUList value... 
  90.      if ucase(RegEnumElement(l))<>ucase(MRUListValue) then
  91.         myPath=sPath & "\" & Item & "\" & RegEnumElement(l)
  92.         myVal=RegReadValue(myPath)
  93.  
  94.         sOut=sOut & myVal & chr(13) & chr(10)
  95.      end if
  96.  
  97.      'do not display then 15 items
  98.      if l>15 then exit for
  99.  next 
  100.  
  101.  GetSingleInfo=sOut
  102. End Function
  103.  
  104.  
  105.  
  106. 'VERSION 1.1
  107. 'returns the readable description for a file TYPE. Input is the
  108. 'raw file type (e.g. ".TXT"). 
  109. Function GetFileDescription(DotType)
  110.   sxd_BasePath="HKLM\Software\Classes\"
  111.  
  112.   sxd_Path=sxd_BasePath & DotType & "\@"
  113.   sxd_Val=RegReadValue(sxd_Path)
  114.  
  115.   if IsEmpty(sxd_Val)=true then
  116.      'extended description not found! return default
  117.      GetFileDescription="<UNKNOWN>"
  118.   else
  119.      'found, now get the "real" description
  120.      sxd_Path=sxd_BasePath & sxd_Val & "\@"
  121.      sxd_Name=RegReadValue(sxd_Path)
  122.      
  123.      if IsEmpty(sxd_Name)=true then
  124.         'argh! 
  125.         GetFileDescription="<UNKNOWN>"
  126.      else
  127.         GetFileDescription=sxd_Name
  128.      end if
  129.   end if
  130.  
  131. End Function
  132.  
  133.  
  134. Function DeleteItem(Item)
  135.  iCount=RegEnumValues(sPath & "\" & Item)
  136.  
  137.  For l=iCount to 1 step -1
  138.      RegDeleteValue(sPath & "\" & Item & "\" & RegEnumElement(l))
  139.  next    
  140.  
  141.  Call RegDeletePath(sPath & "\" & Item)
  142.  
  143.  
  144. End Function
  145.